<template>
  <div class="m-leadsInfo-lead">
    <div class="m-dataList">
      <el-table
        :data="dataList"
        style="width: 100%"
        v-loading="dataListLoading"
        element-loading-text="loading..."
        max-height="500"
      >
        <el-table-column
          prop="project"
          width="200"
          label="项目">
          <template slot-scope="scope">
            <Comp-project-icons :project="scope.row.project"></Comp-project-icons>
          </template>
        </el-table-column>
        <el-table-column
          prop="realName"
          label="姓名"
          width="120">
        </el-table-column>
        <el-table-column
          prop="phone"
          label="手机号"
          width="120">
          <template slot-scope="scope">
            <router-link :to="{name:'LeadDetailsLeade',params:{id:scope.row.id+'_'+scope.row.phone}}">
              {{scope.row.phone}}
            </router-link>
          </template>
        </el-table-column>
        <el-table-column
          prop="otherPhone"
          label="其他手机号"
          width="120">
        </el-table-column>
        <el-table-column
          prop="hstatus"
          label="LEAD状态"
          width="100">
          <template slot-scope="scope">
            <span>{{scope.row.hstatus | hstatusLeadToString}}</span>
          </template>
        </el-table-column>
        <el-table-column
          prop="astatus"
          label="分配状态"
          width="80">
          <template slot-scope="scope">
            <span>{{scope.row.astatus | astatusToString}}</span>
          </template>
        </el-table-column>
        <el-table-column
          prop="assigner"
          label="分配给"
          width="120">
        </el-table-column>
        <el-table-column
          prop="assignTimeStr"
          sortable
          label="分配时间"
          width="160">
        </el-table-column>
        <el-table-column
          prop="createUser"
          label="创建人"
          width="120">
        </el-table-column>
        <el-table-column
          prop="createTimeStr"
          label="创建时间"
          sortable
          width="160">
        </el-table-column>
        <el-table-column
          prop="labels"
          label="标记"
          :show-overflow-tooltip="true"
          min-width="300">
          <template slot-scope="scope">
            <Comp-tags :label="scope.row.labels"></Comp-tags>
          </template>
        </el-table-column>
      </el-table>
    </div>
  </div>
</template>

<script>
  import * as RealaccountAPI from '@/Api/realaccount'
  export default {
    name: 'TheAccountDetailsLead',
    data () {
      return {
        dataList: [],
        dataListLoading:false,
      }
    },
    methods: {
      queryList(){
          this.dataListLoading = true;
        RealaccountAPI.realaccountInfo13({
          id: this.$route.params.id.split("_")[0],
        })
          .then(res => {
            this.dataListLoading = false;
            if (res.code != '0') {
              this.$notify({
                title: '温馨提示',
                message: res.msg,
                type: 'warning'
              })
              return;
            }
            this.dataList = res.data;
          })
          .catch(error => {
            this.dataListLoading = false;
            console.log(error)
          })
      },
    },
    created(){
      this.queryList();
    },
  }
</script>

<style scoped lang="scss">
  .m-leadsInfo-lead {
    padding-top: 24px;
  }
</style>
